home *** CD-ROM | disk | FTP | other *** search
- Path: chrism.demon.co.uk!chris
- From: Chris Marriott <chris@chrism.demon.co.uk>
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.tools.mfc
- Subject: Re: Getting functions out of libraries to work
- Date: Thu, 22 Feb 1996 17:38:52 +0000
- Organization: SkyMap Software
- Distribution: world
- Message-ID: <s8M9GvAsoKLxEwCk@chrism.demon.co.uk>
- References: <312BBC29.6772@uni.massey.ac.nz>
- NNTP-Posting-Host: chrism.demon.co.uk
- X-NNTP-Posting-Host: chrism.demon.co.uk
- MIME-Version: 1.0
- X-Newsreader: Turnpike Version 1.11 <xvymwJsTYh8aYs0yGmHsPZXi9Q>
-
- In article <312BBC29.6772@uni.massey.ac.nz>, Nigel.Ramsay.1@massey.ac.nz
- writes
- >I am trying to get some functions out of a library to work. The problem
- >is that I keep getting an "unresolved external" error whenever I try to
- >call the functions.
- >
- >The funny thing is that it works fine when I compile under just C.
- >
- >I am using Microsoft Visual C++ 1.0, running under Windows 95.
-
- C++ "mangles" names, adding information about argument and return types.
- To call a straght C function, change its prototype in your C++ program
- from:
-
- int foo( int );
-
- to
-
- extern "C" int foo( int );
-
- Chris
- --------------------------------------------------------------------------
- Chris Marriott, Warrington, UK | Author of SkyMap v3 award-winning
- chris@chrism.demon.co.uk | shareware Win31/Win95 planetarium.
- For full info, see http://www.execpc.com/~skymap
- Author member of Association of Shareware Professionals (ASP)
- --------------------------------------------------------------------------
-
-